<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        
    <title>Create Action</title>
    
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js" type="text/javascript"></script>
    <script src="tags.js" type="text/javascript"></script>
    
    <link rel="stylesheet" href="main.css" type="text/css" media="all" />
    <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/base/jquery-ui.css" type="text/css" media="all" />
    
    
    <script>        
        function onActionTypeChange() {
            val = $("#ActionType").val();
            if (val == "petition") {
                 $("#PetitionSurveyFields").show();
            }
            else if (val == "survey") {
                 $("#PetitionSurveyFields").show();
            }
            else if (val = "deliberation") {
                 $("#PetitionSurveyFields").hide();
            }                
        }
        
        $(function () {
            onActionTypeChange();
            
            $("#StartDate, #StopDate").datepicker();
            $("#StartDate, #StopDate").datepicker("option", "dateFormat", 'dd-mm-yy');
            
            $("#ActionType").change(function() {
                onActionTypeChange();
            });
        });
    </script>
    
    
</head>
<body>
    <form action="createaction.php" method="post">
        <div class="form-field"><label for="type">Type: </label>
            <select id="ActionType" name="type" class="fixed-width" >
                <option value="petition">Petition</option>
                <option value="survey">Survey</option>
                <option value="deliberation">Deliberation</option>
            </select></div>
        <div class="form-field"><label for="name">Name: </label>
            <input id="ActionName" name="name" type="text" class="fixed-width" /></div>
        <div class="form-field"><label for="description">Description: </label>
            <textarea id="ActionDescription" name="description" rows="5" cols="60" class="fixed-width"></textarea></div>
        <div class="form-field"><label for="tags">Tags: </label>
            <input id="ActionTags" name="tags" type="text" class="fixed-width"/></div>
        <div class="form-field"><label for="creator">Creator: </label>
            <input id="ActionCreator" name="creator" type="text" class="fixed-width">
    </input></div>
        <div id="PetitionSurveyFields">
            <div class="form-field"><label for="start">Start: </label>
                <input id="StartDate" name="start" type="text" class="fixed-width" /></div>
            <div class="form-field"><label for="stop">Stop: </label>
                <input id="StopDate" name="stop" type="text" class="fixed-width" /></div>
        <div class="form-field"><label for="loginRequired">Requires Log-in: </label>
            <input id="RequiresLogIn" name="loginRequired" type="checkbox" /></div>                
        </div>
        <div class="form-field"><label for="seriesid">SeriesId: </label>
            <input id="seriesid" name="seriesid" type="text" class="fixed-width"  /></div>                
        </div>        
        <div class="form-submit">
            <input type="submit" value="Create" />  
        </div>
    </form> 
    
</body>
</html>